package com.dld.hll.financial;


import com.google.gson.*;
import org.apache.commons.text.StringEscapeUtils;

/**
 * @Author: yue
 * @Date: 2022/11/3 16:58
 */
@lombok.Data
public class Column {

    private String columnName;

    private String dataType;

    public static void main(String[] args) {
        String json = "{\"components\": [{\"id\": \"19\", \"key\": \"collapseSelect__XbQUTfbV_fUST_WecY_RafR_QfYRWSSXYUUZ\", \"mode\": \"expenses\", \"sort\": true, \"type\": \"collapseSelect\", \"uuid\": \"collapseSelect__XbQUTfbV_fUST_WecY_RafR_QfYRWSSXYUUZ\", \"title\": \"费用类型\", \"value\": \"-281091161800790016\", \"isHide\": false, \"required\": true, \"condition\": true, \"typeTitle\": \"费用选择控件框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"rowUrlParam\": \"4\", \"componentType\": \"windowInput\", \"isShowOnDetail\": true}, {\"id\": \"2\", \"key\": \"textarea__YZWSRaUR_cUbe_WbRe_aUba_bUYWcefSQZYf\", \"type\": \"textarea\", \"uuid\": \"textarea__YZWSRaUR_cUbe_WbRe_aUba_bUYWcefSQZYf\", \"title\": \"报销主题\", \"value\": \"\", \"isHide\": false, \"required\": true, \"condition\": false, \"typeTitle\": \"多行文本输入框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请输入\", \"isShowOnDetail\": true}, {\"id\": \"5\", \"key\": \"date__eUWSacQf_dZZc_WdVf_bdcd_RVfdZcdaUZUd\", \"type\": \"date\", \"uuid\": \"date__eUWSacQf_dZZc_WdVf_bdcd_RVfdZcdaUZUd\", \"title\": \"报销日期\", \"value\": \"\", \"isHide\": false, \"required\": true, \"condition\": true, \"typeTitle\": \"日期选择框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"componentType\": \"date\", \"isShowOnDetail\": true}, {\"id\": \"21\", \"key\": \"digest__dXaVfRYV_eZSY_WUQX_RcUX_cfTXdXeVdcVe\", \"type\": \"digest\", \"uuid\": \"digest__dXaVfRYV_eZSY_WUQX_RcUX_cfTXdXeVdcVe\", \"title\": \"摘要\", \"value\": \"\", \"isHide\": true, \"formula\": [], \"required\": false, \"condition\": false, \"typeTitle\": \"摘要\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"摘要\", \"isShowOnDetail\": false}, {\"id\": \"18\", \"key\": \"collapseSelect__ZbYQcfQV_Qfca_WUVc_RYQc_daYdZXYRXQUS\", \"mode\": \"project\", \"type\": \"collapseSelect\", \"uuid\": \"collapseSelect__ZbYQcfQV_Qfca_WUVc_RYQc_daYdZXYRXQUS\", \"title\": \"关联项目\", \"value\": \"\", \"isHide\": false, \"required\": false, \"condition\": false, \"typeTitle\": \"项目选择控件框\", \"valueName\": \"\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"rowUrlParam\": \"\", \"componentType\": \"windowInput\", \"isShowOnDetail\": false, \"rowUrlParamName\": \"\"}, {\"id\": \"14\", \"key\": \"employee__TZVZZfaZ_adQb_WYTW_aXUa_XXTWdUTeTVXd\", \"type\": \"employee\", \"uuid\": \"employee__TZVZZfaZ_adQb_WYTW_aXUa_XXTWdUTeTVXd\", \"title\": \"费用承担人\", \"value\": \"\", \"isHide\": false, \"required\": true, \"condition\": true, \"typeTitle\": \"人员选择框\", \"valueName\": \"\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"componentType\": \"windowInput\", \"isShowOnDetail\": false}, {\"id\": \"4\", \"key\": \"inputPrice__aXZVefWY_TVZV_WaWX_aafW_bRdZXcRRdfYY\", \"type\": \"inputPrice\", \"uuid\": \"inputPrice__aXZVefWY_TVZV_WaWX_aafW_bRdZXcRRdfYY\", \"title\": \"金额\", \"value\": \"\", \"isHide\": false, \"required\": true, \"condition\": false, \"typeTitle\": \"金额输入框\", \"canFormula\": true, \"canSummary\": true, \"placeholder\": \"请输入\", \"componentType\": \"input\", \"isShowOnDetail\": false}, {\"id\": \"14\", \"key\": \"employee__eTUVZYQT_SYUQ_WefY_beVT_RZecRXWeTZXX\", \"sort\": true, \"type\": \"employee\", \"uuid\": \"employee__eTUVZYQT_SYUQ_WefY_beVT_RZecRXWeTZXX\", \"title\": \"收款人\", \"value\": \"\", \"isHide\": false, \"required\": true, \"condition\": false, \"typeTitle\": \"人员选择框\", \"valueName\": \"\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"componentType\": \"windowInput\", \"isShowOnDetail\": false}, {\"id\": \"1\", \"key\": \"input__URYUQdWX_WfZd_WRcT_bZQe_baSVbSTfWQfU\", \"type\": \"input\", \"uuid\": \"input__URYUQdWX_WfZd_WRcT_bZQe_baSVbSTfWQfU\", \"title\": \"收款卡银行支行\", \"value\": \"\", \"isHide\": false, \"required\": false, \"condition\": false, \"typeTitle\": \"单行文本输入框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请输入\", \"isShowOnDetail\": false}, {\"id\": \"1\", \"key\": \"input__acddXTSc_eaQY_WbXS_SQed_bdSbRQZeaeaV\", \"type\": \"input\", \"uuid\": \"input__acddXTSc_eaQY_WbXS_SQed_bdSbRQZeaeaV\", \"title\": \"银行卡号\", \"value\": \"\", \"isHide\": false, \"required\": false, \"condition\": false, \"typeTitle\": \"单行文本输入框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请输入\", \"isShowOnDetail\": false}, {\"id\": \"2\", \"key\": \"textarea__TafSQTTf_RcWc_WbQa_RTYf_ZbQYTXSQTcSR\", \"type\": \"textarea\", \"uuid\": \"textarea__TafSQTTf_RcWc_WbQa_RTYf_ZbQYTXSQTcSR\", \"title\": \"备注\", \"value\": \"\", \"isHide\": false, \"required\": false, \"condition\": false, \"typeTitle\": \"多行文本输入框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请输入\", \"isShowOnDetail\": false}, {\"id\": \"9\", \"key\": \"image__STUbSUQe_eebe_WWeZ_RaUX_bZZeSZbXXRaT\", \"type\": \"image\", \"uuid\": \"image__STUbSUQe_eebe_WWeZ_RaUX_bZZeSZbXXRaT\", \"title\": \"图片\", \"value\": [], \"isHide\": false, \"required\": false, \"condition\": false, \"typeTitle\": \"图片选择框\", \"canFormula\": false, \"canSummary\": false, \"placeholder\": \"请选择\", \"isShowOnDetail\": false}]}";
        System.out.println(json);

        String rj = json.replace("\"", "\\\"");
        System.out.println(rj);
        Gson gson = new GsonBuilder().create();




        String s = StringEscapeUtils.escapeJson(json);
        System.out.println(s);
        JsonElement jsonElement = JsonParser.parseString(json);

        JsonObject jo = jsonElement.getAsJsonObject();
        System.out.println(jo);

        System.out.println(gson.toJson(jo));



    }
}
